fixed url issue removed bug in methods

Judy Ngai преди 9 години
родител
ревизия
f75395974e
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      app/models/agents/aftership_agent.rb

+ 4 - 4
app/models/agents/aftership_agent.rb

@@ -114,11 +114,11 @@ module Agents
114 114
     end
115 115
 
116 116
     def single_tracking_request?
117
-      interpolated[:single_tracking_request] != "false"
117
+      boolify(interpolated[:single_tracking_request])
118 118
     end
119 119
 
120 120
     def last_checkpoint?
121
-      interpolated[:last_checkpoint_request] != "false"
121
+      boolify(interpolated[:last_checkpoint_request])
122 122
     end
123 123
 
124 124
     def working?
@@ -134,7 +134,7 @@ module Agents
134 134
       if single_tracking_request? || last_checkpoint?
135 135
         response = HTTParty.get(single_or_checkpoint_tracking_url, request_options)
136 136
       else
137
-        response = HTTParty.get(trackings_url, request_options)
137
+        response = HTTParty.get(event_url, request_options)
138 138
       end
139 139
       events = JSON.parse response.body
140 140
       create_event :payload => events
@@ -145,7 +145,7 @@ module Agents
145 145
       "https://api.aftership.com/v4/"
146 146
     end
147 147
 
148
-    def trackings_url
148
+    def event_url
149 149
       base_url + "#{URI.encode(interpolated[:get].to_s)}"
150 150
     end
151 151